import 'package:base_plugin/base_plugin.dart';
import 'package:finance_app/generated/l10n.dart';
import 'package:finance_app/src/common/app_colors.dart';
import 'package:finance_app/src/common/app_spaces.dart';
import 'package:finance_app/src/widgets/common/tag_widget.dart';
import 'package:finance_app/src/widgets/select/mixin/check_box_mixin.dart';
import 'package:finance_app/src/widgets/select/mixin/radio_mixin.dart';
import 'package:finance_app/src/widgets/wrapper/normal_form_wrapper.dart';
import 'package:flutter/material.dart';

class EmployeeItemCheckBox = EmployeeItemRadio with CheckBoxMixin;

class EmployeeItemRadio extends StatelessWidget with RadioMixin {
  final String title;
  final String content;
  final bool isSelect;
  final bool isLastItem;
  final bool isEnable;
  final bool isShowTitle;

  const EmployeeItemRadio({
    Key key,
    this.title,
    this.isSelect,
    this.content,
    this.isLastItem = false,
    this.isEnable = true,
    this.isShowTitle = true,
  }) : super(key: key);

  @override
  Widget build(BuildContext context) {
    return NormalFormWrapper(
      topPadding: getDp(18),
      bottomPadding: getDp(18),
      leftPadding: getDp(35),
      rightPadding: getDp(35),
      hasBottomBorder: !isLastItem,
      backgroundColor: !isEnable
          ? aceWhiteGreyColor
          : isSelect
              ? aceLightBlue
              : null,
      child: Row(
        children: [
          buildSelectWidget,
          SizedBox(
            width: getDp(24),
          ),
          Expanded(
            child: Column(
              crossAxisAlignment: CrossAxisAlignment.start,
              mainAxisAlignment: MainAxisAlignment.center,
              children: [
                Text(
                  title,
                  style: TextStyle(
                    color: aceBlackColor,
                    fontSize: getSp(18),
                    fontWeight: FontWeight.w700,
                    height: 14 / 18,
                  ),
                ),
                if (isShowTitle) AppSpaces.h10,
                if (isShowTitle)
                  Text(
                    content ?? S.current.not_title,
                    style: TextStyle(
                      color: aceBlackColor,
                      fontSize: getSp(16),
                      fontWeight: FontWeight.w400,
                      height: 14 / 16,
                    ),
                  ),
              ],
            ),
          ),
        ],
      ),
    );
  }
}
